package com.huirui.server.pojo.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 系统监控数据VO
 * 包含服务器硬件、JVM、磁盘等监控信息
 */
@Data
@Schema(name = "SystemMonitoringDataVo", description = "系统监控数据视图对象")
public class SystemMonitoringDataVo {

    @Schema(description = "CPU核心数", example = "8")
    private Integer cpuCoreCount;

    @Schema(description = "用户态CPU使用率(%)", example = "35.2", minimum = "0", maximum = "100")
    private String userCpuUsageRate;

    @Schema(description = "系统态CPU使用率(%)", example = "12.8", minimum = "0", maximum = "100")
    private String systemCpuUsageRate;

    @Schema(description = "当前CPU空闲率(%)", example = "52.0", minimum = "0", maximum = "100")
    private String currentCpuIdleRate;

    @Schema(description = "系统总内存(字节)", example = "34359738368")
    private String systemTotalMemory;

    @Schema(description = "系统已使用内存(字节)", example = "17179869184")
    private String systemUsedMemory;

    @Schema(description = "系统剩余内存(字节)", example = "17179869184")
    private String systemRemainingMemory;

    @Schema(description = "系统内存使用率(%)", example = "50.0", minimum = "0", maximum = "100")
    private String systemMemoryUsageRate;

    @Schema(description = "JVM总内存(字节)", example = "4294967296")
    private String JVMTotalMemory;

    @Schema(description = "JVM已使用内存(字节)", example = "2147483648")
    private String JVMUsedMemory;

    @Schema(description = "JVM剩余内存(字节)", example = "2147483648")
    private String JVMRemainingMemory;

    @Schema(description = "JVM内存使用率(%)", example = "50.0", minimum = "0", maximum = "100")
    private String JVMMemoryUsageRate;

    @Schema(description = "服务器名称", example = "prod-server-01")
    private String serverName;

    @Schema(description = "服务器IP地址", example = "192.168.1.100")
    private String serverIp;

    @Schema(description = "操作系统名称及版本", example = "CentOS Linux 7.9.2009")
    private String operatingSystem;

    @Schema(description = "系统架构", example = "x86_64")
    private String systemArchitecture;

    @Schema(description = "Java运行环境名称", example = "OpenJDK Runtime Environment")
    private String javaName;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Schema(description = "应用启动时间", example = "2025-11-18T08:30:00", type = "string", format = "date-time")
    private LocalDateTime startupTime;

    @Schema(description = "系统已运行时间")
    private String systemRunningTime;

    @Schema(description = "Java安装路径", example = "/usr/local/jdk1.8.0_381")
    private String installationPath;

    @Schema(description = "项目部署路径", example = "/opt/app/prod-service")
    private String projectPath;

    @Schema(description = "Java版本", example = "1.8.0_381")
    private String javaVersion;

    @Schema(description = "应用运行时长", example = "12小时30分钟15秒")
    private String runtimeDuration;

    @Schema(description = "磁盘信息列表", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private List<DiskInfoVo> diskInfoList;

}
